<%namespace file="../comment/item.mako" import="render_comment"/>
<%def name="render_article(article, **kwargs)">
<%
can_comment = kwargs.get('can_comment', False)
%>
<article class="article">
  <header>
    <h1><a href="${url('article', id=article.id)}">${article.title}</a></h1>
  </header>

  ${article.to_html() | n}

  <footer>
  % if article.labels:
    <p>labels: ${", ".join([label.name for label in article.labels])}</p>
  % endif

  % for comment in article.comments:
    ${render_comment(comment)}
  % endfor

  % if can_comment:
    % if article.comments:
    <label>${_("Post a comment")}</label>
    % else:
    <label>${_("Be the first to post a comment")}</label>
    % endif
    <textarea cols="50" rows="5"></textarea>
  % endif
  </footer>
</article>
</%def>
